package com.headfirst.factory.abstractfactory.pizza;

import com.headfirst.factory.abstractfactory.ingredientfactory.PizzaIngredientFactory;

public class VeggiePizza extends Pizza{
    PizzaIngredientFactory ingredientFactory;

    public VeggiePizza(PizzaIngredientFactory ingredientFactory) {
        this.ingredientFactory = ingredientFactory;
    }

    public void prepare() {
        System.out.println("Preparing "+super.getName());
        super.setDough(ingredientFactory.createDough());
        super.setSauce(ingredientFactory.createSauce());
        super.setCheese(ingredientFactory.createCheese());
        super.setVeggies(ingredientFactory.createVeggies());
    }
}
